<el-dialog :close-on-click-modal="false"  :close-on-press-escape="false"  class="dialogStyleBase" :title="mixinEdit_editTitle" width="700px" :visible.sync="mixinEdit_editVisible"
    :before-close="function(){mixinEdit_editBoxClose('editForm')}" append-to-body>
    <div class="dialogStyleBaseBox"  v-loading="mixinEdit_loading">
        <el-form ref="editForm" :model="form" label-width="100px" label-position="left"
            :disabled="form.activityStatus == 3 && this.mixinEdit_editType == 'update'">

            <LayoutCell>
                <LayoutCellItem title="基本信息">
                    <el-form-item label="活动名称" prop="activityName" :rules="{ required: true, message: '活动名称 不能为空'}">
                        <el-input v-model="form.activityName"></el-input>
                    </el-form-item>
                    <el-form-item label="活动时间">
                        <div class="box">
                            <span>
                                <el-form-item :rules="{ required: true, message: '请选择开始时间'}" prop="startTimeStr">
                                    <el-date-picker v-model="form.startTimeStr" type="datetime" :disabled="isDisabled"
                                        value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期">
                                    </el-date-picker>
                                </el-form-item>
                            </span>
                            <span class="cut">至</span>
                            <span>
                                <el-form-item :rules="{ required: true, message: '请选择结束时间'}" prop="endTimeStr">
                                    <el-date-picker v-model="form.endTimeStr" type="datetime" :disabled="isDisabled"
                                        value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期">
                                    </el-date-picker>
                                </el-form-item>
                            </span>
                        </div>
                    </el-form-item>
                    <el-form-item label="活动类型" prop="activityType">
                        <el-radio-group v-model="form.activityType" @change="radioChange" :disabled="isDisabled">
                            <el-radio :label="1">满X元减</el-radio>
                            <el-radio :label="3">满X件减</el-radio>
                            <el-radio :label="2">满X元折</el-radio>
                            <el-radio :label="4">满X件折</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="优惠内容">
                        <div v-for="(item, index) in form.fullDiscountItemLst" class="activitylevel">
                            <!-- v-if="form.reductionType == 1" -->
                            <div class="level">
                                <span>活动层级{{ index + 1 }}</span>
                                <el-button @click="delfullDiscountItemLst(item, index)" :disabled="isDisabled"
                                    v-if="form.fullDiscountItemLst.length > 1" style="float: right;">删除层级</el-button>
                            </div>
                            <el-form-item label="条件" :rules="{ required: true, message: '条件 不能为空'}">
                                <el-col :span="2">满</el-col>
                                <el-col :span="10">
                                    <el-input-number :disabled="isDisabled" v-model="item.conditionValue"
                                        controls-position="right" :min="minConditionValue(index)">
                                    </el-input-number>
                                </el-col>
                                <span v-if="form.activityType == 1 || form.activityType == 2">元</span>
                                <span v-if="form.activityType == 3 || form.activityType == 4">件</span>
                            </el-form-item>
                            <el-form-item label="优惠" :rules="{ required: true, message: '优惠 不能为空'}">
                                <el-col :span="2">
                                    <span v-if="form.activityType == 1 || form.activityType == 3">减</span>
                                    <span v-if="form.activityType == 2 || form.activityType == 4">打</span>
                                </el-col>
                                <el-col :span="10">
                                    <el-input-number :disabled="isDisabled" v-model="item.discountValue"
                                        controls-position="right" :min="1"
                                        :max="form.activityType == 2 || form.activityType == 4 ? 10:'Infinity'">
                                    </el-input-number>
                                </el-col>
                                <span v-if="form.activityType == 1 || form.activityType == 3">元</span>
                                <span v-if="form.activityType == 2 || form.activityType == 4">折</span>
                            </el-form-item>
                            <!-- <el-form-item label="每人最多减" :rules="{ required: true, message: '每人最多减 不能为空'}"
                                v-if="form.reductionType == 2">
                                <el-col :span="2">减</el-col>
                                <el-col :span="10">
                                    <el-input :disabled="isDisabled" v-model="item.fullDiscountId"></el-input>
                                </el-col>
                                <span>元</span>
                            </el-form-item> -->
                        </div>
                        <el-button :disabled="isDisabled" @click="addfullDiscountItemLst()">添加活动层级</el-button>
                    </el-form-item>
                </LayoutCellItem>

                <LayoutCellItem title="优惠规则">
                    <!-- 优惠规则 -->
                    <el-form-item label="适用商品">
                        <!-- // 应用类型 1全部商品 2商品分组 3商品分类 4指定商品 -->
                        <el-radio-group v-model="form.applyType" :disabled="isDisabled">
                            <el-radio :label="1">全部商品</el-radio>
                            <el-radio :label="4">指定商品</el-radio>
                            <el-radio :label="2">指定分组</el-radio>
                            <el-radio :label="3">指定分类</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="指定商品" v-if="form.applyType==4" prop="fullDiscountProductLst"
                        :rules="{ required: true, message: '商品 不能为空'}">
                        <SelectDataGoods v-model="form.fullDiscountProductLst" :appWindow="appWindow"
                            :apiConfig="$vFN.Tools.getAppGlobalData('componentsApiConfig.SelectDataGoods',appWindow)">
                        </SelectDataGoods>
                    </el-form-item>
                    <el-form-item label="指定分组" v-if="form.applyType==2" prop="fullDiscountProductGroupsLst"
                        :rules="{ required: true, message: '分组 不能为空'}">
                        <SelectDataGoodsGroup style="width:420px" v-model="form.fullDiscountProductGroupsLst"
                            :appWindow="appWindow"
                            :apiConfig="$vFN.Tools.getAppGlobalData('componentsApiConfig.SelectDataGoodsGroup',appWindow)">
                        </SelectDataGoodsGroup>
                    </el-form-item>
                    <el-form-item label="指定分类" v-if="form.applyType==3" prop="fullDiscountProductCategoryLst"
                        :rules="{ required: true, message: '分类 不能为空'}">
                        <SelectDataGoodsClassify style="width:420px" v-model="form.fullDiscountProductCategoryLst"
                            :appWindow="appWindow"
                            :apiConfig="$vFN.Tools.getAppGlobalData('componentsApiConfig.SelectDataGoodsClassify',appWindow)">
                        </SelectDataGoodsClassify>

                    </el-form-item>
                    <el-form-item label="下单可用抵扣" prop="deductOverlayLst">
                        <el-checkbox-group :disabled="isDisabled" v-model="form.deductOverlayLst">
                            <el-checkbox v-for="item in deducteList" :label="item.id" :checked="item.isChecked">{{
                                item.name }}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                </LayoutCellItem>

            </LayoutCell>

        </el-form>
    </div>
    <div slot="footer">
        <el-row>
            <!-- <el-col :span="12" style="text-align: left;">
                <el-button @click="mixinEdit_resetForm('editForm')">重 置</el-button>
            </el-col> -->
            <el-col :span="24">
                <el-button :disabled="form.activityStatus === 3 && mixinEdit_editType != 'copy'"
                    @click="mixinEdit_editBoxClose('editForm')">取 消
                </el-button>
                <el-button :disabled="form.activityStatus === 3 && mixinEdit_editType != 'copy'" type="primary"
                    @click="mixinEdit_editFormSubmit({model:'form',ref:'editForm'})">确
                    定</el-button>
            </el-col>
        </el-row>
    </div>
</el-dialog>